This application claims priority to Korean Patent Application No. 2003-40481, filed on Jun. 21, 2003, in the Korean Intellectual Property Office, the disclosure of which is incorporated herein in its entirety by reference.
1. Field of the Invention
The present invention relates to a method and system for generating a random number, and more particularly, to generating the random number using sector numbers within a disk drive.
2. Description of the Related Art
Random numbers are used in many applications, and especially in cryptography which is broadly defined as “the art and science of keeping data secure.” Three major elements of data security include authentication, confidentiality, and integrity.
Authentication ensures that only an authorized user has access to data. An example protocol for authentication using a random number is as follows:
A. a user requests access to data that is password protected on a server;
B. the server responds with a random challenge which is a random number combined with other information;
C. the user encrypts the random challenge using its password as a key and returns the encrypted challenge to the server;
D. the server encrypts the same random challenge with the user's password retrieved from its own database; and
E. the server compares the two encrypted random challenges, and if they are the same, the user is authorized to have access to the data.
In this manner, because the random challenge is used, the user is authorized without the user ever sending just the password over a network. In addition, because a random number is used, the random challenge constantly changes over time for secure authorization.
Confidentiality ensures that an unauthorized person is not able to extract meaningful data from encrypted data. Data encryption is the process of combining plain text with a cryptographic key to generate encrypted data which ideally is impossible to decrypt without a decryption key. Random numbers, used for such encryption and description keys, are essential for data encryption.
Integrity detects for undesired tampering to data using a digital signature which is a binary string of fixed length (i.e., a cryptography hash) unique to a given message and signed with the originator's private key. A user having the originator's public key decrypts the message and is ensured that the owner of the private key originated the message. Random numbers are used to generate such digital signatures.
In this manner, random numbers are essential for the various data security protocols, and a higher degree of randomness of the random number enhances the level of security.
FIGS. 1 and 2 show a flowchart and a system 100 for generating a random number according to the prior art. The system 100 includes a data processor 102 that receives a variable SEED from a system timer 104 (step 106 of FIG. 1). The system timer 104 generates SEED depending on the current time at the system 100. The data processor 102 then sets a variable X(n)=SEED, initially with n=0 (step 108 of FIG. 1). Next, the RANDOM NUMBER X(n+1) is generated as follows (step 110 of FIG. 1):RANDOM NUMBER, X(n+1)=[1103515245*X(n)+12345] mod M 
Such an equation is an example of a linear congruential random number generator calculated by the data processor 102 of FIG. 2. This equation for X(n+1) is described in the well-known book entitled The C Programming Language by Brian W. Kernighan and Dennis M. Ritchie. Such an equation for X(n+1) includes modular arithmetic with mod M that returns a random integer in the range [0-(M-1)], when the SEED=X(0) is also in a range of [0-(M-1)]. For example, if the SEED=X(0) is eight bits long, the SEED is in a range of 0 to (2811)=255, and M=256.
After the RANDOM NUMBER X(n+1) is calculated at step 110 and if n is not greater than 7 (step 116 of FIG. 1), X(n+1) is stored within a data buffer 112 in the system 100 (step 110 of FIG. 1). In addition in that case, n is incremented by 1 (i.e., n=n+1) (step 116 of FIG. 1), and the flowchart loops back to step 110 to calculate the next X(n+1) with the incremented n. On the other hand, if n is great than 7, the flowchart of FIG. 1 ends.
Thus, steps 110, 114, and 116 are repeated until n>7 when X(1), X(2), X(3), X(4), X(5), X(6), X(7), and X(8) are generated and stored within the data buffer 112. The binary bits of such random numbers X(1), X(2), X(3), X(4), X(5), X(6), X(7), and X(8) may be sequentially appended to form a random number of increased bits. For example, when the SEED from the timer 104 is just eight bits long, each of the random numbers X(1), X(2), X(3), X(4), X(5), X(6), X(7), and X(8) is also eight bits long. To generate a random number that is 64-bits long, X(1), X(2), X(3), X(4), X(5), X(6), X(7), and X(8) are sequentially appended together.
Any random number generated from calculation by a data processor is not “purely random.” In contrast, tossing a dice or movement of an electron are “purely random” physical processes. Thus, a random number generated from calculation by a data processor is deemed to be “pseudo random.” Such a pseudo random number follows a same repeatable pattern when the starting SEED is the same, and there is only a finite set of possible SEED values.
Thus, the quality (i.e., the level of randomness) of a pseudo random number generator depends on the quality of the SEED value. The SEED value is desired to be as random as possible and is desired to have high complexity meaning a high number of bits that are as unpredictable as possible.
The prior art method and system of FIGS. 1 and 2 are disadvantageous because the SEED value from the timer 104 is comprised of only eight bits. In addition, because the SEED value is dependent on the current time from the timer 104, such a value may not necessarily be unpredictable.
Data security is becoming an important factor in HDD (hard disk drives) for modern consumer electronics. A hard disk drive has advantages of random access, high data transmission speed, low cost, and high capacity as compared with other auxiliary memory devices. Thus, hard disk drives are being widely used in storing multimedia data for example.
In particular, a personal video recorder (PVR) is generally used for storing digital audio/video (AV) data received from broadcasting stations on a hard disk drive and reproducing the stored digital AV data. The digital AV data is generally encrypted and scrambled, so that it cannot be used without a valid broadcast receiver. However, the digital AV data to be stored on the hard disk drive may be intercepted during transmission by an unauthorized third party. Thus, various measures have been taken to prevent such interception.
For example, Korean Patent Publication No. 2001-27550 discloses a device for storing received digital AV data on a hard disk drive through repeated descrambling and encryption. The device includes a random number generator having a different initial value with respect to each broadcast receiver for such descrambling and encryption.
In any case, because data security is becoming such an important factor for hard disk drive applications, a mechanism for generating a random number with high randomness is desired.